#-*- coding: utf-8 -*-

from cocos.sprite import Sprite 
from base import CObject
from ctrl import CCtrl

class CPlayer(Sprite,CObject):
	m_Img="player.png"

	def __init__(self):
		Sprite.__init__(self,self.m_Img)
		self.m_Scene=0
		self.m_vx=0
		self.m_vy=0
		self.m_Speed=200
		self.do(CCtrl())

	def _getx(self):
		return self.position[0]

	def _gety(self):
		return self.position[1]

	def _setx(self,x):
		p=self.position
		self.position=(x,p[1])

	def _sety(self,y):
		p=self.position
		self.position=(p[0],y)

	x=property(_getx,lambda self,x: self._setx(x))
	y=property(_gety,lambda self,y: self._sety(y))
